#pragma once

#include <string>
#include <WinSock2.h>

namespace jlh
{
	class NetInterface
	{
	public:
		static std::string GetLocalIPAddress();
	};

	class SocketUtil
	{
	public:
		static bool Bind(SOCKET  sockfd, std::string ip, uint16_t port);
		static void SetNonBlock(SOCKET fd);
		static void SetBlock(SOCKET fd, int writeTimeout);
		static void SetReuseAddr(SOCKET sockfd);
		static void SetNoDelay(SOCKET sockfd);
		static void SetKeepAlive(SOCKET sockfd);
		static void SetSendBufSize(SOCKET sockfd, int size);
		static void SetRecvBufSize(SOCKET sockfd, int size);
		static void Close(SOCKET sockfd);
	};

}



